package cn.edu.scau.cmi.wuyihan.mutiton;

import java.util.ArrayList;
import java.util.List;

public class Marshal {
	
	private static Marshal marshal;
	private String name;
	private static List<String> names = new ArrayList<>();
	
	private Marshal(String name) {
		this.name = name;
	}
	
	public static Marshal getInstance(String name) {
		if(!name.equals(null)) {
			if (!names.contains(name)) {
				names.add(name);
				marshal = new Marshal(name);
				return marshal;
			}
		}		
		return null;
	}
	
	@Override
	public String toString() {
		return name + super.toString();
	}
}
